﻿using dotHTML.HTML;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Text;

namespace TestdotHTML
{
    
    
    /// <summary>
    ///This is a test class for FieldSetTest and is intended
    ///to contain all FieldSetTest Unit Tests
    ///</summary>
    [TestClass()]
    public class FieldSetTest {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext {
            get {
                return testContextInstance;
            }
            set {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for FieldSet Constructor
        ///</summary>
        [TestMethod()]
        public void FieldSetConstructorTest() {
            FieldSet target = new FieldSet();
            Assert.AreEqual("<fieldset></fieldset>", target.ToString());
        }

        /// <summary>
        ///A test for Disabled
        ///</summary>
        [TestMethod()]
        public void DisabledTest() {
            FieldSet target = new FieldSet();
            bool expected = false;
            bool actual;
            target.Disabled = expected;
            actual = target.Disabled;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Form
        ///</summary>
        [TestMethod()]
        public void FormTest() {
            FieldSet target = new FieldSet();
            Form expected = new Form();
            Form actual;
            target.Form = expected;
            actual = target.Form;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Name
        ///</summary>
        [TestMethod()]
        public void NameTest() {
            FieldSet target = new FieldSet();
            string expected = string.Empty;
            string actual;
            target.Name = expected;
            actual = target.Name;
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ToStringTest() {
            FieldSet f = new FieldSet();
            Form frm = new Form();
            frm.ID = "formid";
            f.Disabled = true;
            f.Form = frm;
            f.Name = "name";
            Assert.AreEqual("<fieldset disabled=\"disabled\" " +
                "form=\"formid\" " +
                "name=\"name\"></fieldset>", f.ToString());
        }
    }
}
